<?php
/*\
 *  ExtJS - oh.framework
 *  --------------------
 *  name: extjs
 *  sign: 7
 *	date: 
 *  desc: high level ui to develop rich web apps
\*/	oh_module_header();


// Interface function   
function oh_function_extjs($tokens) {
	return oh_this();
} 

// Main class
class oh_class_extjs { 
	var $purl = 'http://localhost/oh-php-framework/oh.framework/modules/extjs/ext-4.0.0';
	var $iurl = 'http://localhost/oh-php-framework/oh.framework/modules/extjs/icons';
	function oh_class_extjs() {
		global $oh;
		$this->purl = $oh['url'].'/modules/extjs/ext-4.0.0';
		$this->iurl = $oh['url'].'/modules/extjs/icons';
	}
	function css() {
		echo '<link rel="stylesheet" type="text/css" href="'.$this->purl.'/resources/css/ext-all.css" />';
	}
	function bootstrap() {
		echo '<script type="text/javascript" src="'.$this->purl.'/bootstrap.js"></script>';
	}
	function iconpath() {
		return $this->iurl."/fam";
	}
	function css_icons($icons) {
		echo '<style type="text/css">'."\n";
		foreach($icons as $class=>$file) {
			echo '.'.$class.' { background-image:url('.$this->iconpath().'/'.$file.') !important;}'."\n";
		}		
		echo '</style>'."\n";
	}
}
